package com.oneplatform.user.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.jeesuite.springweb.model.WrapperResponse;
import com.oneplatform.user.dao.entity.UserAssetsEntity;
import com.oneplatform.user.service.UserAssetsService;

import io.swagger.annotations.ApiOperation;

/**
 * generated by www.jeesuite.com
 */
@Controller
@RequestMapping("/user_assets")
public class UserAssetsController {

    private @Autowired UserAssetsService userAssetsService;
	
	@ApiOperation(value = "按用户查询账户")
	@RequestMapping(value = "list", method = RequestMethod.GET)
    public @ResponseBody WrapperResponse<List<UserAssetsEntity>> findUserAssetsUserId(Integer userId) {
		List<UserAssetsEntity> list = userAssetsService.findUserAssetsUserId(userId);
		return new WrapperResponse<>(list);
	}
	
	@ApiOperation(value = "按id查询账户")
	@RequestMapping(value = "{id}", method = RequestMethod.GET)
    public @ResponseBody WrapperResponse<UserAssetsEntity> getById(@PathVariable("id") int id) {
		UserAssetsEntity entity = userAssetsService.findUserAssetsById(id);
		return new WrapperResponse<>(entity);
	}
	
	
}
